package com.kapukapu.authorization.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerSecurityConfiguration;

/**
 * @author: sivan
 * @date: 2020/03/08
 * @email: zifanuu@gmail.com
 */
@Configuration
public class JwtOAuth2SecurityConfig extends AuthorizationServerSecurityConfiguration {
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        super.configure(http);
        http
            .requestMatchers()
            .mvcMatchers("/.well-known/jwks.json")
            .and()
            .authorizeRequests()
            .mvcMatchers("/.well-known/jwks.json")
            .permitAll();
    }
}
